#pragma once
#include "Shader.h"

namespace Graphics
{
	class Texture;
}

namespace Graphics
{
class ProjectionShader : public Shader
{
	RTTI_DECLARATIONS(ProjectionShader, Graphics::Shader)
private:
	struct MatrixBufferType
	{
		D3DXMATRIX world;
		D3DXMATRIX view;
		D3DXMATRIX projection;
		D3DXMATRIX view2;
		D3DXMATRIX projection2;
	};
	
	struct LightBufferType
	{
		D3DXVECTOR4 ambientColor;
		D3DXVECTOR4 diffuseColor;
		D3DXVECTOR3 lightDirection;
		float padding;
	};

public:
	ProjectionShader(void);

	virtual ~ProjectionShader(void);
	
	bool Initialize();

	void Deinitialize();

	bool Render(int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix,  
				Texture* texture, D3DXVECTOR4, D3DXVECTOR4, D3DXVECTOR3, D3DXMATRIX, D3DXMATRIX, Texture*);

private:
	bool InitializeShader(HWND winHandle, const char* vertexShaderName, const char*  pixelShaderName);

	void DeinitializeShader();

	bool SetShaderParameters(int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix,  
				Texture* texture, D3DXVECTOR4, D3DXVECTOR4, D3DXVECTOR3, D3DXMATRIX, D3DXMATRIX, Texture*);

private:
	ID3D11Buffer* mLightBuffer;
};
}